<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>基于Python的高校新闻网络爬虫系统设计与实现</title>

  <!-- 引入 echarts.js -->
  <script src="static/assets/js/echarts.min.js"></script>

  <meta content="" name="descriptison">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="static/assets/img/favicon.png" rel="icon">
  <link href="static/assets/img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i,900" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="static/assets/vendor/icofont/icofont.min.css" rel="stylesheet">
  <link href="static/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="static/assets/vendor/animate.css/animate.min.css" rel="stylesheet">
  <link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
  <link href="static/assets/vendor/aos/aos.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="static/assets/css/style.css" rel="stylesheet">

</head>

<body>



  <!-- ======= Header ======= -->
  <header id="header">
    <div class="container">

      <div class="logo float-left">
        <h1 class="text-light"><a href="/"><span>高宇龙</span></a></h1>
        <!-- Uncomment below if you prefer to use an image logo -->
        <!-- <a href="temp.html"><img src="static/assets/img/logo.png" alt="" class="img-fluid"></a>-->
      </div>

      <nav class="nav-menu float-right d-none d-lg-block">
        <ul>
{#            新闻总条数，各类型条数#}
          <li class="active"><a href="/">首页<i class="la la-angle-down"></i></a></li>
          <li><a href="/new">标题展示</a></li>
            {#         类型比例分布饼图 #}
          <li><a href="/type">类型分布</a></li>
{#           新闻关键字 #}
          <li><a href="/word">词云</a></li>
          <li><a href="/hot">热搜榜</a></li>


        </ul>
      </nav><!-- .nav-menu -->

    </div>
  </header><!-- End Header -->

  <!-- =======主页内容======= -->
    <div class="section-title">
      <h2>新闻比例分布</h2>
    </div>

        <!-- ======= 主页内容6+1个 ======= -->
    <section class="counts section-bg">
      <div class="container">
          <div class="row">
             <div class="col-lg-6  text-center">
               <!-- 条形比例 -->
               <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
              <div id="main1" style="width: 600px;height:400px;display:inline;"></div>

             </div>

             <div class="col-lg-6 text-center" data-aos-delay="800">
              <!-- 饼图 -->
               <div id="main2" style="width: 600px;height:400px;display:inline;"></div>
             </div>
          </div>
      </div>

        <script type="text/javascript">
            // 基于准备好的dom，初始化echarts实例
            var myChart1 = echarts.init(document.getElementById('main1'));

            // 指定图表的配置项和数据
           option1 = {
                title: {
                    text: '新闻总量'
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                legend: {
                    data: [ '//新闻条数']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'value',
                    boundaryGap: [0, 0.01]
                },
                yAxis: {
                    type: 'category',
                    data: {{ type|tojson }},
                    <!--这个数据传到前端会被转义，需要转化为json-->
                    <!--['专题网站','文明创建', '理论学习', '媒体聚焦', '综合新闻', '学校要闻']-->
                    axisLabel: {
                       show: true,
                        textStyle: {
                          fontSize : 20      //更改坐标轴文字大小
                        }
                    }
                },
                series: [

                    {
                        name: '新闻条数',
                        type: 'bar',
                        data: {{ num }},
                           <!-- [19325,19325, 23438, 31000, 121594, 134141, 681807]-->
                        label: {
                                "normal": {
                                    "show": true,
                                    "textStyle": {
                                        "fontSize":20 }
                                },
                                "emphasis": {
                                    "show": true
                                },
                        }
                    }
                ]

            };
            // 使用刚指定的配置项和数据显示图表。
            myChart1.setOption(option1);

            // 基于准备好的dom，初始化echarts实例
            var myChart2 = echarts.init(document.getElementById('main2'));
            // 指定图表的配置项和数据
            option2 = {
                title: {
                text: '新闻类型',
                left: 'center'
                },
                tooltip: {
                    trigger: 'item',
                    {#formatter: '{a} <br/>{b}: {c} ({d}%)'#}
                    formatter: '{b}: {c} ({d}%)'
                },
                legend: {
                    orient: 'vertical',
                    left: 10,
                    data: []
                },
                series: [

                    {
                        name: '',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        label: {
                            formatter: ' {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            textStyle: {
                                  "fontSize": 15 //c的大小
                            },
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },

                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 15,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        },
                        data: [
                            {value: {{num[0]}}, name: {{type[0]|tojson}}},
                            {value: {{num[1]}}, name: {{type[1]|tojson}}},
                            {value: {{num[2]}}, name: {{type[2]|tojson}}},
                            {value: {{num[3]}}, name: {{type[3]|tojson}}},
                            {value: {{num[4]}}, name: {{type[4]|tojson}}},
                            {value: {{num[5]}}, name: {{type[5]|tojson}}}
                        ]
                    }
                ]
            };

            // 使用刚指定的配置项和数据显示图表。
            myChart2.setOption(option2);
        </script>

    </section><!-- End Counts Section -->



  <a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

  <!-- Vendor JS Files -->
  <script src="static/assets/vendor/jquery/jquery.min.js"></script>
  <script src="static/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="static/assets/vendor/jquery.easing/jquery.easing.min.js"></script>
{#  <script src="static/assets/vendor/php-email-form/validate.js"></script>#}
  <script src="static/assets/vendor/jquery-sticky/jquery.sticky.js"></script>
  <script src="static/assets/vendor/venobox/venobox.min.js"></script>
  <script src="static/assets/vendor/waypoints/jquery.waypoints.min.js"></script>
  <script src="static/assets/vendor/counterup/counterup.min.js"></script>
  <script src="static/assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
  <script src="static/assets/vendor/aos/aos.js"></script>

  <!-- Template Main JS File -->
  <script src="static/assets/js/main.js"></script>

</body>

</html>